/**
 * 已知数组A的元素积是2023，从中删除K个数得到数组B，
 * 现在给定数组B，问能否还原出数组A
 * 将B连乘，然后被2023除即可
 */
#include <bits/stdc++.h>
using namespace std;

#include <bits/extc++.h>
using namespace __gnu_pbds;

using llt = long long;
using vi  =vector<int>;
using pii = pair<int, int>;
using vvi = vector<vi>;
using vpii = vector<pii>;

int N, M, Q, K;
vi B;

void proc(){
    llt tmp = 1;
    // sort(B.begin(), B.end());
    // B.erase(unique(B.begin(), B.end()), B.end());
    
    for(auto i : B){
        tmp *= i;
    }
    if(2023 % tmp) return (void)(cout << "NO\n");
    tmp = 2023 / tmp;
    cout << "YES\n";
    cout << tmp;
    for(int i=1;i<K;++i) cout << " 1";
    cout << "\n"; 
}

int main(){
#ifndef ONLINE_JUDGE
    freopen("z.txt", "r", stdin);
#endif
    ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie(0);
    int nofkase = 1;
    cin >> nofkase;
    while(nofkase--){
        cin >> N >> K;
        B.assign(N, {});
        for(auto & i : B) cin >> i;
        proc();
    }
    return 0;
}